package com.byd.dms.enums;

import com.alibaba.fastjson.parser.DefaultJSONParser;
import com.alibaba.fastjson.parser.JSONLexer;
import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;

import java.lang.reflect.Type;

public class StatusDeserializer implements ObjectDeserializer {
    
    public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
        JSONLexer lexer = parser.getLexer();
        int value = lexer.intValue();
        
        System.out.println("type = " + type);
        System.out.println("fieldName = " + fieldName);
        System.out.println("value = " + value);
        System.out.println("Status.create(value) = " + Status.create(value));
        
        return (T) Status.create(value);
    }
    
    public int getFastMatchToken() {
        return 0;
    }
}

